﻿using System.Data.Entity.ModelConfiguration;
using Nop.Core.Domain.Coffee;

namespace Nop.Data.Mapping.Coffee
{
    public partial class RecipeBlendMap : EntityTypeConfiguration<RecipeBlend>
    {
        public RecipeBlendMap() 
        {
            this.ToTable("EcrRecipeBlendMap");
            this.HasKey(rbm => rbm.Id);
            this.HasRequired(rbm => rbm.Blend)
                .WithMany(b => b.RecipeBlends)
                .HasForeignKey(rbm => rbm.BlendId);
            this.HasRequired(rbm => rbm.Recipe)
                .WithMany(b => b.RecipeBlends)
                .HasForeignKey(rbm => rbm.RecipeId);
            
        }
    }
}
